<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/static/lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="/static/css/public.css" media="all">
    <style>
        body {
            background-color: #ffffff;
        }
    </style>
</head>
<body>
<div class="layui-form layuimini-form">
    <div class="layui-form layuimini-form">
        <input type="text" name="id" id="id" style="display: none"
               class="layui-input">
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">产品名称</label>
                <div class="layui-input-block">
                    <input type="text" name="itemName" id="itemName"
                           value=""
                           class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">产品编号</label>
                <div class="layui-input-block">
                    <input type="text" name="itemNo" id="itemNo"
                           value="" class="layui-input">
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">产品单位</label>
                <div class="layui-input-block">
                    <input type="text" name="itemUnit" id="itemUnit"
                           value="" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">产品重量(kg)</label>
                <div class="layui-input-block">
                    <input type="number" name="itemWeight" id="itemWeight"
                           value="" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">材质分析</label>
                <div class="layui-input-block">
                    <input type="text" name="itemQuality" id="itemQuality"
                           placeholder="" value=""
                           class="layui-input">
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">客人货号</label>
                <div class="layui-input-block">
                    <input type="text" name="customerItemsNo" id="customerItemsNo"
                           value="" class="layui-input">
                </div>
            </div>
            <div class="layui-inline" id="customerPriceShow">
                <label class="layui-form-label">客人价格</label>
                <div class="layui-input-block">
                    <input type="number" name="customerPrice" id="customerPrice"
                           value="" class="layui-input">
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">工厂货号</label>
                <div class="layui-input-block">
                    <input type="text" name="supplierItemsNo" id="supplierItemsNo"
                           value="" class="layui-input">
                </div>
            </div>
            <div class="layui-inline" id="supplierPriceShow">
                <label class="layui-form-label">工厂价格</label>
                <div class="layui-input-block">
                    <input type="number" name="supplierPrice" id="supplierPrice"
                           value="" class="layui-input">
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">产品尺寸(cm)</label>
                <div class="layui-input-inline" style="width: 100px;">
                    <input type="number" name="itemSizeLength" id="itemSizeLength"
                           value="" class="layui-input">
                </div>
                <div class="layui-form-mid">*</div>
                <div class="layui-input-inline" style="width: 100px;">
                    <input type="number" name="itemSizeWidth" id="itemSizeWidth"
                           value="" class="layui-input">
                </div>
                <div class="layui-form-mid">*</div>
                <div class="layui-input-inline" style="width: 100px;">
                    <input type="number" name="itemSizeHeight" id="itemSizeHeight"
                           value="" class="layui-input">
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">产品尺寸(英寸)</label>
                <div class="layui-input-inline" style="width: 100px;">
                    <input type="number" name="itemSizeLengthInch" id="itemSizeLengthInch"
                           value="" disabled="disabled" class="layui-input">
                </div>
                <div class="layui-form-mid">*</div>
                <div class="layui-input-inline" style="width: 100px;">
                    <input type="number" name="itemSizeWidthInch" id="itemSizeWidthInch"
                           value="" disabled="disabled" class="layui-input">
                </div>
                <div class="layui-form-mid">*</div>
                <div class="layui-input-inline" style="width: 100px;">
                    <input type="number" name="itemSizeHeightInch" id="itemSizeHeightInch"
                           value="" disabled="disabled" class="layui-input">
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">内箱(cm)</label>
                <div class="layui-input-inline" style="width: 100px;">
                    <input type="number" name="innerBoxSizeLength" id="innerBoxSizeLength"
                           value="" class="layui-input">
                </div>
                <div class="layui-form-mid">*</div>
                <div class="layui-input-inline" style="width: 100px;">
                    <input type="number" name="innerBoxSizeWidth" id="innerBoxSizeWidth"
                           value="" class="layui-input">
                </div>
                <div class="layui-form-mid">*</div>
                <div class="layui-input-inline" style="width: 100px;">
                    <input type="number" name="innerBoxSizeHeight" id="innerBoxSizeHeight"
                           value="" class="layui-input">
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">内箱(英寸)</label>
                <div class="layui-input-inline" style="width: 100px;">
                    <input type="number" name="innerBoxSizeLengthInch" id="innerBoxSizeLengthInch"
                           value="" disabled="disabled"  class="layui-input">
                </div>
                <div class="layui-form-mid">*</div>
                <div class="layui-input-inline" style="width: 100px;">
                    <input type="number" name="innerBoxSizeWidthInch" id="innerBoxSizeWidthInch"
                           value="" disabled="disabled" class="layui-input">
                </div>
                <div class="layui-form-mid">*</div>
                <div class="layui-input-inline" style="width: 100px;">
                    <input type="number" name="innerBoxSizeHeightInch" id="innerBoxSizeHeightInch"
                           value="" disabled="disabled" class="layui-input">
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">外箱(cm)</label>
                <div class="layui-input-inline" style="width: 100px;">
                    <input type="number" name="boxSizeLength" id="boxSizeLength"
                           value="" class="layui-input">
                </div>
                <div class="layui-form-mid">*</div>
                <div class="layui-input-inline" style="width: 100px;">
                    <input type="number" name="boxSizeWidth" id="boxSizeWidth"
                           value="" class="layui-input">
                </div>
                <div class="layui-form-mid">*</div>
                <div class="layui-input-inline" style="width: 100px;">
                    <input type="number" name="boxSizeHeight" id="boxSizeHeight"
                           value="" class="layui-input">
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">外箱(cm)</label>
                <div class="layui-input-inline" style="width: 100px;">
                    <input type="number" name="boxSizeLengthInch" id="boxSizeLengthInch"
                           value="" disabled="disabled" class="layui-input">
                </div>
                <div class="layui-form-mid">*</div>
                <div class="layui-input-inline" style="width: 100px;">
                    <input type="number" name="boxSizeWidthInch" id="boxSizeWidthInch"
                           value="" disabled="disabled" class="layui-input">
                </div>
                <div class="layui-form-mid">*</div>
                <div class="layui-input-inline" style="width: 100px;">
                    <input type="number" name="boxSizeHeightInch" id="boxSizeHeightInch"
                           value="" disabled="disabled" class="layui-input">
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">立方数(m³)</label>
                <div class="layui-input-block">
                    <input type="number" name="cubeNumber" id="cubeNumber"
                           value="" disabled="disabled"
                           class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">才数(m³)</label>
                <div class="layui-input-block">
                    <input type="number" name="justCount" id="justCount"
                           value="" disabled="disabled"
                           class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">外箱-毛重(kg)</label>
                <div class="layui-input-block">
                    <input type="number" name="boxSroughWeight" id="boxSroughWeight"
                           value="" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">外箱-毛重(磅)</label>
                <div class="layui-input-block">
                    <input type="number" name="boxSroughWeightBl" id="boxSroughWeightBl"
                           value="" class="layui-input">
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">外箱-净重(kg)</label>
                <div class="layui-input-block">
                    <input type="number" name="boxSuttle" id="boxSuttle"
                           value="" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">外箱-净重(磅)</label>
                <div class="layui-input-block">
                    <input type="number" name="boxSuttleBl" id="boxSuttleBl"
                           value="" disabled="disabled" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">工厂</label>
                <div class="layui-input-block">
                    <input type="text" name="supplierName" id="supplierName"
                           value="" class="layui-input">
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-upload">
                <input type="text" name="photo" id="photo" style="display: none"
                       class="layui-input">
                <blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;">
                    预览图：
                    <div class="layui-upload-list" id="uploadImg"></div>
                </blockquote>
            </div>
        </div>
    </div>
</div>
<script src="/static/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script src="/static/lib/jquery-3.4.1/jquery-3.4.1.min.js" charset="utf-8"></script>
<script src="/static/lib/jq-module/jquery.particleground.min.js" charset="utf-8"></script>
<script src="/static/js/common.js"></script>
<script>
    let user = $.common.getUserInfo();
    if ( 0 != user.powerDataType) {
        $('#customerPrice').attr("disabled",true);
        $('#supplierPrice').attr("disabled",true);
    }
    if (2 == user.powerDataType) {
        $('#customerPriceShow').css("display","none");
        $('#supplierPriceShow').css("display","none");
    }
    var inchs = [];
    $('[id]').each(function() {
        if($(this).attr('id').endsWith('Inch')) {
            inchs.push($(this).attr('id'));
        }
    });
    if (inchs) {
        for(let i = 0; i < inchs.length; i++) {
            let inch=inchs[i];
            let select = "#" + inch ;
            let selectOld ="#" + inch.substr(0,inch.length - 4)
            $(selectOld).bind('change', function (da) {
                let w = parseFloat($(selectOld).val());
                let c = w / 2.54;
                $(select).val(c.toFixed(2));
            })
        }
    }
    var bls = [];
    $('[id]').each(function() {
        if($(this).attr('id').endsWith('Bl')) {
            bls.push($(this).attr('id'));
        }
    });
    if (bls) {
        for(let i = 0; i < bls.length; i++) {
            let bl=bls[i];
            let select = "#" + bl ;
            let selectOld ="#" + bl.substr(0,bl.length - 2)
            $(selectOld).bind('change', function (da) {
                let w = parseFloat($(selectOld).val());
                let c = w * 2.2;
                $(select).val(c.toFixed(2));
            })
        }
    }
</script>
</body>
</html>
